@extends('back.index')
@section('title','课程管理')

@section('style')
    <style>
        .dunk_all{width:600px;marign:0 auto;}
        .form-group{margin-top:20px;width:590px;}
        .dunk_ps{width:400px;}
        img{width:192px;height:108px;}
        th{text-align:center;}
        td{border-right:1px solid #ccc;height:100px;}
    </style>
@endsection

@section('mian')
    <div style="font-size:14px;padding:20px;" class="modal-content">
        <h2>
            <input type="submit" class="btn btn-info btn-lg" value="添加专栏" data-toggle="modal" data-target="#myModal">
            <span class="glyphicon glyphicon-hand-left"></span>
            <!-- Modal -->
            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document" style="z-index:1111;">
                    <div style="font-size:14px;" class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h3 class="modal-title" style="text-align:center;" id="myModalLabel">添加专栏:</h3>
                        </div>
                        <div class="dunk_all">
                            <form  class="form-horizontal" action="{{url('back/center/add_infomation')}}" method="post" enctype="multipart/form-data">
                                {{csrf_field()}}
                                <div class="form-group" style="margin-top:20px;">
                                    <label for="inputEmail3" class="col-sm-2 control-label">添加图片:</label>
                                    <div class="col-sm-10">
                                        <input type="file"  class="dunk_ps" name="icon">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="inputEmail3" class="col-sm-2 control-label">标头:</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="dunk_ps form-control" name="header">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="inputEmail3" class="col-sm-2 control-label">资讯标题:</label>
                                    <div class="col-sm-10">
                                        <input type="text" placeholder="填写标题" class="dunk_ps form-control" name="title">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="inputEmail3" class="col-sm-2 control-label">专栏内容:</label>
                                    <div class="col-sm-10">
                                        <textarea style="left: 98px;height: 138px;resize: none;overflow: auto;" class="dunk_ps form-control" name="text" id="passport_userdetail">

                                        </textarea>
                                    </div>
                                </div>
                                <div class="modal-footer" style=" border-top:none;text-align:center;">
                                    <input style="width:200px;" class="btn btn-info" type="submit" value="确定">
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </h2>
        <div class="my-order-wrap">
            <table class="table table-hover my-order-list" data-token="b85c364572f96a34c7a2e04eeee935e4">
                <thead>
                <tr class="info" style="text-align:center;">
                    <th>ID</th>
                    <th>图片</th>
                    <th>标头</th>
                    <th class="order-shoop-h">添加时间</th>
                    <th class="order-name-h">资讯标题</th>
                    <th style="width:400px;" class="order-time-h">资讯内容</th>
                    <th class="" style="width:100px;">操作</th>
                </tr>
                </thead>
                <tbody>
                @if(empty(count($infomation)))
                    <tr>
                        <td style="background-color:#A2D8F2;line-height:10;height:100px;text-align:center;font-size:20px;" colspan="7">暂无数据</td>
                    </tr>
                @else
                @foreach($infomation as $k)
                    <tr>
                        <td>
                            <div class="ie8-td-fixed">
                               {{$k->id}}
                            </div>
                        </td>
                        <td>
                            <div class="ie8-td-fixed">
                                <img src="{{asset('image/infomation/'.$k->icon)}}" alt="">
                            </div>
                        </td>
                        <td>
                            <div class="ie8-td-fixed">
                                {{$k->header}}
                            </div>
                        </td>
                        <td>
                            <div class="ie8-td-fixed">
                                {{date('Y-m-d',$k->addtime)}}
                            </div>
                        </td>
                        <td>
                            <div class="ie8-td-fixed">
                                {{$k->title}}
                            </div>
                        </td>
                        <td>
                            <div style="height:100px;overflow: auto;" class="ie8-td-fixed">
                                {{$k->text}}
                            </div>
                        </td>
                        <td style="text-align:center">
                            <a href="{{url('back/center/edit_infomation/'.$k->id)}}">修改 </a>
                            <span style="color:red"> | </span>
                            <a href="{{url('back/center/del_infomation/'.$k->id)}}">删除</a>
                        </td>
                    </tr>
                @endforeach
                 @endif
                </tbody>
            </table>
            {{$infomation->links()}}
        </div>
    </div>
@endsection